#include <iostream>
#include <cmath>
using namespace std;
bool isZhiShu(int n);
int main()
{
	int n;
	int max = 0;
	cin >> n;
	if(n == 1)
	{
		cout << 1 << endl;
		return 0;
	}else if(n == 2)
	{
		cout << 2 << endl;
		return 0;
	}else if(n == 3){
		cout << 3 << endl;
		return 0;
	}
	for(int i = 2;i <= pow(n,0.5);i++)
	{
		if(n % i == 0)
		{
			max = n / i;
		}
	}
	
	cout << max << endl;
	
	return 0;	
} 

